package com.hd.persistence.dao;

import java.util.List;

import com.hd.common.DataPage;
import com.hd.common.HibernateEntityDao;
import com.hd.persistence.model.Machine;

public class MachineDao extends HibernateEntityDao<Machine> {
	
	public DataPage<Machine> pageQueryMachines(int pageNo, int pageSize) {
		String hql = new String("from Machine ");
		return pagedQuery(hql, pageNo, pageSize);
	}

	public List<Machine> listMachine(){
		String hql = new String("from Machine ");
		List<Machine> machines = find(hql);
		return machines;
	}
	
	public DataPage<Machine> pageQueryMachines(int category, int pageNo, int pageSize) {
		String hql = new String("from Machine where category = " + category);
		return pagedQuery(hql, pageNo, pageSize);
	}
}
